import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
import path from 'path';
export default defineConfig({
  plugins: [vue()],
  base: './', //配置打包之后的静态资源目录
  resolve: {
    alias: {
      '@': path.resolve('src'),
      'component': path.resolve('src', 'component'),
      'pages': path.resolve('scr', 'pages')
    }
  },
  server: {
    port: 8080,
    proxy: {
      '/api': {
        target: 'http://chst.vip',
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
});
